package com.liyang.springcloud.service;

import com.liyang.springcloud.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * @author liyanng
 * openFeign 账户服务调用
 * @date
 */
@FeignClient(contextId = "account", value = "seata-account-service")
public interface AccountService {

    /**
     * @description: 账户金额 扣除
     * @author: liyang
     * @date: 2024/1/10 9:58
     * @param: userId 账户ID
     * @param: money 金额
     * @return: com.liyang.springcloud.domain.CommonResult
     **/
    @PostMapping(value = "/account/decrease")
    CommonResult decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money);

}
